package br.sddp.util;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 * Classe utilizada para gerencia o EntityManager.
 * @author v0rtex
 *
 */
public class JPAUtil {

	/**
	 * Utilizado para criar o EntityManager
	 */
	private static EntityManagerFactory factory = Persistence.createEntityManagerFactory("sddp");

	/**
	 * Este metodo retorna uma conexao.
	 * 
	 * @return EntityManager
	 */
	public EntityManager getEntityManager() {
		return factory.createEntityManager();
	}
}
